package com.rs.game.npc.others;

import com.rs.game.Entity;
import com.rs.game.WorldTile;
import com.rs.game.npc.NPC;
import com.rs.game.player.controlers.quests.lostcity.LostCityDungeon;

public class TreeSpirit extends NPC {
	
	private static final long serialVersionUID = 8542259578980922247L;
	
	private LostCityDungeon lostCityDungeon;
	
	public TreeSpirit(int id, WorldTile tile, LostCityDungeon lostCityDungeon) {
		super(id, tile, -1, true, true);
		this.lostCityDungeon = lostCityDungeon;
	}
	
	@Override
	public void sendDeath(Entity source) {
		if (lostCityDungeon != null) {
			lostCityDungeon.targetDied();
			lostCityDungeon = null;
		}
		super.sendDeath(source);
	}
	
	public void disappear() {
		lostCityDungeon = null;
		finish();
	}
}